package com.meizi.lushi.controller;

import java.util.Arrays;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.meizi.lushi.entity.InSkillAttrEntity;
import com.meizi.lushi.service.InSkillAttrService;
import com.meizi.core.tool.api.PageUtils;
import com.meizi.core.tool.api.R;



/**
 * 
 *
 * @author meizi
 * @email enjoymeizi@gmail.com
 * @date 2021-10-15 14:08:56
 */
@RestController
@RequestMapping("lushi/inskillattr")
public class InSkillAttrController {
    @Autowired
    private InSkillAttrService inSkillAttrService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("lushi:inskillattr:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = inSkillAttrService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("lushi:inskillattr:info")
    public R info(@PathVariable("id") Integer id){
		InSkillAttrEntity inSkillAttr = inSkillAttrService.getById(id);

        return R.ok().put("inSkillAttr", inSkillAttr);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("lushi:inskillattr:save")
    public R save(@RequestBody InSkillAttrEntity inSkillAttr){
		inSkillAttrService.save(inSkillAttr);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("lushi:inskillattr:update")
    public R update(@RequestBody InSkillAttrEntity inSkillAttr){
		inSkillAttrService.updateById(inSkillAttr);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("lushi:inskillattr:delete")
    public R delete(@RequestBody Integer[] ids){
		inSkillAttrService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
